package com.zdb;

import com.zdb.Runabble.Test01Runablle;
import com.zdb.Runabble.Test02Runable;

import java.util.concurrent.*;

public class Main {
    public static void main(String[] args) {

        ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(5,
                10,
                1000,
                TimeUnit.MILLISECONDS,
                    new LinkedBlockingQueue<>(1000),
                Executors.defaultThreadFactory()
                );


        ExecutorService executorService = Executors.newFixedThreadPool(6);
        ExecutorService executorService1 = Executors.newCachedThreadPool();
        ExecutorService executorService2 = Executors.newSingleThreadExecutor();
        Test01Runablle test01Runablle = new Test01Runablle();
        Test02Runable test02Runable = new Test02Runable();
        Future<?> submit = threadPoolExecutor.submit(test01Runablle);
        Future<?> submit1 = threadPoolExecutor.submit(test02Runable);
        System.out.println("submit1 = " + submit1);
        System.out.println("submit = " + submit);
        threadPoolExecutor.execute(test01Runablle);
    }
}